#include "Face.h"
#include "../Character.h"

#include <stdlib.h>
#include <math.h>

#include <iostream>
#include <vector>

using namespace std;

Steering* Face::getSteering(){
  Steering* ret = new Steering();
  float direction[3];

  // hay que considerar el camino en el grafo al objetivo
  if( !theCharacter->caminoObjetivo.empty() ){
    target->position[0] =
        theCharacter->caminoObjetivo[1]->getPosition()[0];
    target->position[1] =
        theCharacter->caminoObjetivo[1]->getPosition()[1];
  }

  restarVectores(target->position, character->position, direction);
  if (length(direction) == 0){
//  cout << " leng(direction) es 0" <<endl;
    return ret;
  }

  target->orientation = atan2(direction[0],direction[1]);
  return Align::getSteering();
}
